home *** CD-ROM | disk | FTP | other *** search
/ MacFormat España 22 / macformat_22.iso / Shareware / Programación / The Gray Council 1.1 / source / MacApp / GrayCouncilMA.h < prev   
Encoding:
Text File  |  1996-08-08  |  28.2 KB  |  849 lines  |  [TEXT/CWIE]

  1. //
  2. // GrayCouncilMA
  3. // Copyright ©1996 by Trygve Isaacson. All Rights Reserved.
  4. //
  5. // MacApp adapter classes for core Gray Council.
  6. //
  7. // Before using any of the GrayCouncil source code, read and
  8. // follow the licensing info in the accompanying documentation
  9. // or contact:
  10. //   <trygve@kagi.com>
  11. //   <http://www.kagi.com/authors/trygve/>
  12. //
  13. // GrayCouncil provides a set of standard C++ classes that implement
  14. // the standard Apple Grayscale Appearance. The core classes do not
  15. // require any other code such as a particular class framework.
  16. //
  17. // This file defines a set of helper classes that derive from standard
  18. // MacApp view classes, and interface with the core Gray Council code.
  19. // There are also a couple of adorner subclasses for attaching to windows
  20. // and list boxes to get the correct background color or target border.
  21. //
  22. // Normally, to use a GrayCouncil MacApp class, you can simply change the
  23. // class name of the subview in your resource file or AdLib view to the
  24. // class name of the appropriate Gray Council MacApp adapter class. For
  25. // example, to use the GC pushbutton, create a normal TButton subview,
  26. // and set its class name to AGAPushButtonMA. Voila.
  27. //
  28. // A couple of the classes use the userData field of the subview to specify
  29. // additional information such as icon IDs, string resource IDs, etc.
  30. //
  31. // To statically instantiate one of these MacApp subclasses at runtime,
  32. // not via a view resource, use the class' supplied "I" method.
  33. //
  34. // Each class here that interfaces to a core AGAObject has a public
  35. // member variable called mAGAObject that points to the actual AGAObject
  36. // subclass object. Certain extended object settings (such as mixed-state
  37. // buttons, proportional and live scrolling, etc.) require you to call
  38. // the AGAObject to set it. The member variable is made public to keep
  39. // these MacApp classes as lightweight as possible; you make the call,
  40. // rather than using myriad new functions of the MacApp AGA subclasses.
  41. //
  42. // Classes defined below:
  43. //    AGAPushButtonMA -- TButton subclass for AGAPushButton
  44. //    AGACheckBoxMA -- TCheckBox subclass for AGACheckBox
  45. //    AGARadioButtonMA -- TRadio subclass for AGARadioButton
  46. //    AGAIconPushButtonMA -- AGAPushButtonMA (TButton) subclass for AGAIconPushButton
  47. //    AGAIconCheckBoxMA -- AGACheckBoxMA (TCheckBox) subclass for AGAIconCheckBox
  48. //    AGAIconRadioButtonMA -- AGARadioButtonMA (TRadio) subclass for AGAIconRadioButton
  49. //    AGAScrollBarMA -- TScrollBar subclass for AGAScrollBar
  50. //    AGAScrollerScrollBarMA -- TScrollerScrollBar subclass for AGAScrollBar
  51. //        Remember the difference between TScrollBar and TScrollerScrollBar!
  52. //    AGASliderMA -- TControl subclass for AGASlider
  53. //    AGABackgroundAdornerMA -- TAdorner subclass that you should attach to
  54. //        typical modeless windows; gives it the proper modeless gray background
  55. //    AGAModalBackgroundAdornerMA -- AGABackgroundAdornerMA (TAdorner) subclass
  56. //        that you should attach to modal windows (i.e., things you PoseModally);
  57. //        gives it the proper modal gray background
  58. //    AGAWhiteBackgroundAdornerMA -- TAdorner subclass you should attach to any
  59. //        view that needs a white background but lives in a gray background window
  60. //        (e.g., TEditText, TScroller containing grid, etc.)
  61. //    AGABorderFrameAdornerMA -- TAdorner subclass that you can attach to any
  62. //        view that needs a "3D" sunken frame around it (e.g., the same things
  63. //        that need a white background adorner)
  64. //    AGAPopupMA -- TPopup subclass for AGAPopupMenu
  65. //    AGAStaticTextMA -- TStaticText subclass for AGAStaticText 
  66. //    AGALittleArrowsMA -- TControl subclass for AGALittleArrows
  67. //    AGADisclosureTriangleMA -- TControl subclass for AGADisclosureTriangle
  68. //    AGAProgressIndicatorMA -- TControl subclass for AGAProgressIndicator
  69. //    AGASeparatorMA -- TView subclass for AGASeparator
  70. //    AGATargetBorderViewMA -- TTargetBorderView subclass that draws AGA-style
  71. //        target border frame
  72. //    AGATargetBorderFrameViewMA -- AGATargetBorderViewMA (TTargetBorderView)
  73. //        subclass that draws a "3D" sunken frame just like an AGABorderFrameAdornerMA
  74. //        in addition to the AGA-compatible TTargetBorderView.
  75. //    AGAGroupBoxMA -- TCluster subclass for AGAGroupBox
  76. //    AGASecondaryGroupBoxMA -- AGAGroupBoxMA (TCluster) subclass for AGAGroupBox
  77. //        with secondary box style set
  78. //
  79.  
  80. #ifndef __GRAYCOUNCILMA__
  81. #define __GRAYCOUNCILMA__
  82.  
  83. #include "GrayCouncil.h"
  84. #include "UDialog.h"
  85.  
  86. //
  87. // You must call InitGrayCouncilMA after initializing the MacApp and the
  88. // Toolbox and before instantiating any GrayCouncil objects. This routine
  89. // registers the MacApp classes and then calls the core InitGrayCouncil
  90. // function for you. If it returns an error, you should quit. The only
  91. // current error situation of this is an out-of-memory condition
  92. // during initialization.
  93. //
  94.  
  95. extern OSErr InitGrayCouncilMA();
  96.  
  97. //
  98. // AGAPushButtonMA ----------------------------------------------------
  99. //
  100. // TButton replacement subclass. Automatically detects presence of a
  101. // TRRectAdorner to make the AGAPushButton take on the default button
  102. // appearance. You could also set kIsDefault state manually.
  103. //
  104.  
  105. class AGAPushButtonMA : public TButton
  106.     {
  107.     MA_DECLARE_CLASS;
  108.  
  109.     public:
  110.  
  111.         AGAPushButtonMA();
  112.         virtual ~AGAPushButtonMA();
  113.  
  114.         // TButton-compatible I method
  115.         void IAGAPushButtonMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, const CStr255& itsLabel);
  116.  
  117.         // MacApp overrides
  118.         virtual void DoPostCreate(TDocument* itsDocument);
  119.         virtual void Draw(const VRect& area);
  120.         virtual void SetFrame(const VRect& newFrame, Boolean invalidate); 
  121.         virtual void DoMouseCommand(VPoint& theMouse, TToolboxEvent* event, CPoint hysteresis);
  122.         virtual void HiliteState(Boolean state, Boolean redraw);
  123.         virtual void Hilite();
  124.         virtual void DimState(Boolean state, Boolean redraw);
  125.         virtual void Dim();
  126.  
  127.         AGAPushButton*    mAGAObject;
  128.  
  129.     protected:
  130.  
  131.         virtual void CreateAGAObject();
  132.  
  133.         TAdorner*    FindRRectAdorner();
  134.     };
  135.  
  136. //
  137. // AGACheckBoxMA ----------------------------------------------------
  138. //
  139. // TCheckBox replacement subclass. To use mixed-state capability,
  140. // set/get the AGACheckBox state directly.
  141. //
  142.  
  143. class AGACheckBoxMA : public TCheckBox
  144.     {
  145.     MA_DECLARE_CLASS;
  146.  
  147.     public:
  148.  
  149.         AGACheckBoxMA();
  150.         virtual ~AGACheckBoxMA();
  151.  
  152.         // TCheckBox-compatible I method
  153.         void IAGACheckBoxMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, const CStr255& itsLabel, Boolean isTurnedOn);
  154.  
  155.         // MacApp overrides
  156.         virtual void DoPostCreate(TDocument* itsDocument);
  157.         virtual void Draw(const VRect& area);
  158.         virtual void SetFrame(const VRect& newFrame, Boolean invalidate); 
  159.         virtual void DoMouseCommand(VPoint& theMouse, TToolboxEvent* event, CPoint hysteresis);
  160.         virtual void HiliteState(Boolean state, Boolean redraw);
  161.         virtual void Hilite();
  162.         virtual void DimState(Boolean state, Boolean redraw);
  163.         virtual void Dim();
  164.         virtual Boolean IsOn();
  165.         virtual void SetState(Boolean state, Boolean redraw);
  166.         virtual void Toggle(Boolean redraw);
  167.         virtual void ToggleIf(Boolean matchState, Boolean redraw);
  168.  
  169.         AGACheckBox*    mAGAObject;
  170.  
  171.     protected:
  172.  
  173.         virtual void CreateAGAObject();
  174.     };
  175.  
  176. //
  177. // AGARadioButtonMA ----------------------------------------------------
  178. //
  179. // TRadio replacement subclass. To use mixed-state capability,
  180. // set/get the AGARadioButton state directly.
  181. //
  182.  
  183. class AGARadioButtonMA : public TRadio
  184.     {
  185.     MA_DECLARE_CLASS;
  186.  
  187.     public:
  188.  
  189.         AGARadioButtonMA();
  190.         virtual ~AGARadioButtonMA();
  191.  
  192.         // TRadio-compatible I method
  193.         void IAGARadioButtonMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, const CStr255& itsLabel, Boolean isTurnedOn);
  194.  
  195.         // MacApp overrides
  196.         virtual void DoPostCreate(TDocument* itsDocument);
  197.         virtual void Draw(const VRect& area);
  198.         virtual void SetFrame(const VRect& newFrame, Boolean invalidate); 
  199.         virtual void DoMouseCommand(VPoint& theMouse, TToolboxEvent* event, CPoint hysteresis);
  200.         virtual void HiliteState(Boolean state, Boolean redraw);
  201.         virtual void Hilite();
  202.         virtual void DimState(Boolean state, Boolean redraw);
  203.         virtual void Dim();
  204.         virtual Boolean IsOn();
  205.         virtual void SetState(Boolean state, Boolean redraw);
  206.         virtual void Toggle(Boolean redraw);
  207.         virtual void ToggleIf(Boolean matchState, Boolean redraw);
  208.  
  209.         AGARadioButton*    mAGAObject;
  210.  
  211.     protected:
  212.  
  213.         virtual void CreateAGAObject();
  214.     };
  215.  
  216. //
  217. // AGAIconPushButtonMA ----------------------------------------------------
  218. //
  219. // TButton replacement subclass that implements an icon button that behaves
  220. // like a TButton -- you click it and it sends its fEventNumber. When
  221. // instantiated from a view resource, the fUserArea is used to obtain the
  222. // button's icon ID. You can also set the icon ID of the AGAIconPushButton
  223. // directly (cast the mAGAObject to AGAIconPushButton*).
  224. //
  225.  
  226. class AGAIconPushButtonMA : public AGAPushButtonMA
  227.     {
  228.     MA_DECLARE_CLASS;
  229.  
  230.         // TButton-compatible I method
  231.         void IAGAIconPushButtonMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, const CStr255& itsLabel);
  232.  
  233.     protected:
  234.  
  235.         // AGAPushButtonMA override
  236.         virtual void CreateAGAObject();
  237.     };
  238.  
  239. //
  240. // AGAIconCheckBoxMA ----------------------------------------------------
  241. //
  242. // TCheckBox replacement subclass that implements an icon button that behaves
  243. // like a check box -- you click it and it toggles its on/off state. When
  244. // instantiated from a view resource, the fUserArea is used to obtain the
  245. // button's icon ID. You can also set the icon ID of the AGAIconCheckBox
  246. // directly (cast the mAGAObject to AGAIconCheckBox*). If you want the on/off
  247. // states to have different icons, you can specify different icon IDs.
  248. //
  249.  
  250. class AGAIconCheckBoxMA : public AGACheckBoxMA
  251.     {
  252.     MA_DECLARE_CLASS;
  253.  
  254.         // TCheckBox-compatible I method
  255.         void IAGAIconCheckBoxMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, const CStr255& itsLabel, Boolean isTurnedOn);
  256.  
  257.     protected:
  258.  
  259.         // AGACheckBoxMA override
  260.         virtual void CreateAGAObject();
  261.     };
  262.  
  263. //
  264. // AGAIconRadioButtonMA ----------------------------------------------------
  265. //
  266. // TRadio replacement subclass that implements an icon button that behaves
  267. // like a radio button -- you click it and it turns on, and notifies its
  268. // cluster so that the others in its group are turned off. When
  269. // instantiated from a view resource, the fUserArea is used to obtain the
  270. // button's icon ID. You can also set the icon ID of the AGAIconRadioButton
  271. // directly (cast the mAGAObject to AGAIconRadioButton*). If you want the on/off
  272. // states to have different icons, you can specify different icon IDs.
  273. //
  274.  
  275. class AGAIconRadioButtonMA : public AGARadioButtonMA
  276.     {
  277.     MA_DECLARE_CLASS;
  278.  
  279.         // TRadio-compatible I method
  280.         void IAGAIconRadioButtonMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, const CStr255& itsLabel, Boolean isTurnedOn);
  281.  
  282.     protected:
  283.  
  284.         // AGARadioButtonMA override
  285.         virtual void CreateAGAObject();
  286.     };
  287.  
  288. //
  289. // AGAScrollBarMA ----------------------------------------------------
  290. //
  291. // TScrollBar replacement subclass. To use live scrolling, set the
  292. // AGAScrollBar state directly and either install a notification routine
  293. // or handle the scroll bar's fEventNumber by checking the current value.
  294. // To use proportional indicator, set the AGAScrollBar state directly.
  295. //
  296. // Please note that TScrollBar and TScrollerScrollBar are different!
  297. //
  298.  
  299. typedef void (*AGANotifyMAPtr)(TView* theIndicator, SInt32 dataValue, void* userData);
  300.  
  301. class AGAScrollBarMA : public TScrollBar
  302.     {
  303.     MA_DECLARE_CLASS;
  304.  
  305.     public:
  306.  
  307.         AGAScrollBarMA();
  308.         virtual ~AGAScrollBarMA();
  309.  
  310.         // TScrollBar-compatible I method
  311.         void IAGAScrollBarMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, VHSelect itsDirection, long itsVal, long itsMin, long itsMax);
  312.  
  313.         // MacApp overrides
  314.         virtual void DoPostCreate(TDocument* itsDocument);
  315.         virtual void Draw(const VRect& area);
  316.         virtual void SetFrame(const VRect& newFrame, Boolean invalidate); 
  317.         virtual void SetLongVal(VCoordinate itsVal, Boolean redraw);
  318.         virtual void DoMouseCommand(VPoint& theMouse, TToolboxEvent* event, CPoint hysteresis);
  319.         virtual void HiliteState(Boolean state, Boolean redraw);
  320.         virtual void Hilite();
  321.         virtual void DimState(Boolean state, Boolean redraw);
  322.         virtual void Dim();
  323.         virtual void Activate(Boolean entering);
  324.         virtual void SetLongMax(VCoordinate itsMax, Boolean redraw);
  325.         
  326.         virtual void    InstallNotificationRoutine(AGANotifyMAPtr notificationRoutine, void* userData);
  327.         virtual void    HandleNotification(SInt32 dataValue);
  328.         
  329.         AGANotifyMAPtr    mNotificationRoutine;
  330.         void*            mUserData;
  331.  
  332.         AGAScrollBar*    mAGAObject;
  333.  
  334.     protected:
  335.  
  336.         virtual void CreateAGAObject();
  337.         
  338.         static void RealAGANotifier(AGATrackingIndicator* theIndicator, SInt32 dataValue, void* userData);
  339.     };
  340.  
  341. //
  342. // AGAScrollerScrollBarMA ----------------------------------------------------
  343. //
  344. // TScrollerScrollBar replacement subclass. To use live scrolling, just set
  345. // the AGAScrollBar state directly; the scroller will get the live scroll
  346. // nofication messages automatically. To use proportional indicator,
  347. // set the AGAScrollBar state directly.
  348. //
  349. // Please note that TScrollBar and TScrollerScrollBar are different!
  350. //
  351.  
  352. class AGAScrollerScrollBarMA : public TScrollerScrollBar
  353.     {
  354.     MA_DECLARE_CLASS;
  355.  
  356.     public:
  357.  
  358.         AGAScrollerScrollBarMA();
  359.         virtual ~AGAScrollerScrollBarMA();
  360.  
  361.         // TScrollerScrollBar-compatible I method
  362.         void IAGAScrollerScrollBarMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, VHSelect itsDirection, long itsMax, TScroller* itsScroller);
  363.  
  364.         // MacApp overrides
  365.         virtual void DoPostCreate(TDocument* itsDocument);
  366.         virtual void Draw(const VRect& area);
  367.         virtual void SetFrame(const VRect& newFrame, Boolean invalidate); 
  368.         virtual void AttachScroller(TScroller* itsScroller);
  369.         virtual void SetLongVal(VCoordinate itsVal, Boolean redraw);
  370.         virtual void DoMouseCommand(VPoint& theMouse, TToolboxEvent* event, CPoint hysteresis);
  371.         virtual void HiliteState(Boolean state, Boolean redraw);
  372.         virtual void Hilite();
  373.         virtual void DimState(Boolean state, Boolean redraw);
  374.         virtual void Dim();
  375.         virtual void Activate(Boolean entering);
  376.         virtual void SetLongMax(VCoordinate itsMax, Boolean redraw);
  377.         
  378.         virtual void    InstallNotificationRoutine(AGANotifyMAPtr notificationRoutine, void* userData);
  379.         virtual void    HandleNotification(SInt32 dataValue);
  380.         virtual void    UpdateScrollAmounts();
  381.         
  382.         AGANotifyMAPtr    mNotificationRoutine;
  383.         void*            mUserData;
  384.  
  385.         AGAScrollBar*    mAGAObject;
  386.  
  387.     protected:
  388.  
  389.         virtual void CreateAGAObject();
  390.         
  391.         static void RealAGANotifier(AGATrackingIndicator* theIndicator, SInt32 dataValue, void* userData);
  392.     };
  393.  
  394. //
  395. // AGASliderMA ----------------------------------------------------
  396. //
  397. // TControl subclass. To set/get the value, access the AGASlider
  398. // directly. When instantiated from a view resource, the fUserArea,
  399. // if non-zero, is used as the resource ID of an 'STR#' resource
  400. // that contains the slider labels; in this case, the range is
  401. // automatically set to match the number of labels, and the slider
  402. // will have a pointy indicator. If the ID is zero or invalid, the
  403. // slider will be rectangular.
  404. //
  405.  
  406. class AGASliderMA : public TControl
  407.     {
  408.     MA_DECLARE_CLASS;
  409.  
  410.     public:
  411.  
  412.         AGASliderMA();
  413.         virtual ~AGASliderMA();
  414.  
  415.         // TControl-compatible I method
  416.         void IAGASliderMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, const TextStyle& itsTextStyle = gSystemStyle);
  417.  
  418.         // MacApp overrides
  419.         virtual void DoPostCreate(TDocument* itsDocument);
  420.         virtual void Draw(const VRect& area);
  421.         virtual void SetFrame(const VRect& newFrame, Boolean invalidate); 
  422.         virtual void DoMouseCommand(VPoint& theMouse, TToolboxEvent* event, CPoint hysteresis);
  423.         virtual void DimState(Boolean state, Boolean redraw);
  424.         virtual void Dim();
  425.  
  426.         AGASlider*    mAGAObject;
  427.  
  428.     protected:
  429.  
  430.         virtual void CreateAGAObject();
  431.     };
  432.  
  433. //
  434. // AGABackgroundAdornerMA ----------------------------------------------------
  435. //
  436. // An adorner that you should attach to typical modeless windows if you
  437. // want the standard AGA gray background. It should be placed BEFORE the
  438. // "Draw Adorner".
  439. //
  440.  
  441. class AGABackgroundAdornerMA : public TAdorner
  442.     {
  443.     MA_DECLARE_CLASS;
  444.  
  445.     public:
  446.  
  447.         AGABackgroundAdornerMA();
  448.  
  449.         // MacApp overrides
  450.         virtual void DoHighlightSelection(TView* itsView, const VRect& area, HLState fromHL, HLState toHL);
  451.         virtual void Draw(TView* itsView, const VRect& area);
  452.         virtual void ViewChangedFrame(TView* itsView, const VRect& oldFrame, const VRect& newFrame, Boolean    invalidate);
  453.  
  454.     protected:
  455.  
  456.         virtual void DrawBackground(TView* itsView, const VRect& area, Boolean fill, Boolean active);
  457.         virtual Boolean HasGrowBox(TView* itsView);
  458.  
  459.         enum { kBGFill, kBGActiveLight, kBGActiveShadow, kBGInactiveLight, kBGInactiveShadow, kBGNumIndexes };
  460.  
  461.         SInt32    mRampIndexes[kBGNumIndexes];
  462.     };
  463.  
  464. //
  465. // AGAModalBackgroundAdornerMA ----------------------------------------------------
  466. //
  467. // An adorner that you should attach to typical modal windows (dialogs)
  468. // in order to get the standard AGA modal gray background. It should be placed
  469. // BEFORE the "Draw Adorner".
  470. //
  471.  
  472. class AGAModalBackgroundAdornerMA : public AGABackgroundAdornerMA
  473.     {
  474.     MA_DECLARE_CLASS;
  475.  
  476.     public:
  477.  
  478.         AGAModalBackgroundAdornerMA();
  479.  
  480.     protected:
  481.  
  482.         virtual void DrawBackground(TView* itsView, const VRect& area, Boolean fill, Boolean active);
  483.     };
  484.  
  485. //
  486. // AGAWhiteBackgroundAdornerMA ----------------------------------------------------
  487. //
  488. // An adorner that you should attach to any subview where the window has
  489. // a gray background but the particular subview needs a white background.
  490. // Editable text fields and list boxes are the most common examples. It should
  491. // be placed BEFORE the "Draw Adorner".
  492. //
  493.  
  494. class AGAWhiteBackgroundAdornerMA : public TAdorner
  495.     {
  496.     MA_DECLARE_CLASS;
  497.  
  498.     public:
  499.  
  500.         // MacApp overrides
  501.         virtual void Draw(TView* itsView, const VRect& area);
  502.     };
  503.  
  504. //
  505. // AGABorderFrameAdornerMA ----------------------------------------------------
  506. //
  507. // An adorner that you should attach to any subview where the subview
  508. // needs a "3D" sunken frame around it. Editable text fields and list
  509. // boxes are the most common examples. It should be placed AFTER the
  510. // "Draw Adorner".
  511. //
  512.  
  513. class AGABorderFrameAdornerMA : public TAdorner
  514.     {
  515.     MA_DECLARE_CLASS;
  516.  
  517.     public:
  518.  
  519.         // MacApp overrides
  520.         virtual void Draw(TView* itsView, const VRect& area);
  521.     };
  522.  
  523. //
  524. // AGAPopupMA ----------------------------------------------------
  525. //
  526. // TPopup replacement subclass.
  527. //
  528.  
  529. class AGAPopupMA : public TPopup
  530.     {
  531.     MA_DECLARE_CLASS;
  532.  
  533.     public:
  534.  
  535.         AGAPopupMA();
  536.         virtual ~AGAPopupMA();
  537.  
  538.         // TPopup-compatible I method
  539.         void IAGAPopupMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, short itsMenuID, short itsCurrentItem, short itsItemOffset, short itsStrListID, short itsIndex, short itsStyle, short itsJust, Boolean useAddResMenu, ResType useAddResMenuResType, const TextStyle& itsTextStyle = gSystemStyle);
  540.  
  541.         // MacApp overrides
  542.         virtual void DoPostCreate(TDocument* itsDocument);
  543.         virtual void Draw(const VRect& area);
  544.         virtual void SetFrame(const VRect& newFrame, Boolean invalidate); 
  545.         virtual void DoMouseCommand(VPoint& theMouse, TToolboxEvent* event, CPoint hysteresis);
  546.         virtual void DimState(Boolean state, Boolean redraw);
  547.         virtual void Dim();
  548.         
  549.         // TPopup and TControl overrides
  550.         virtual void AttachMenuRef(MenuRef itsMenuRef);                // installs the menu
  551.         virtual void SetText(const CStr255& title, Boolean redraw);    // sets the popup title
  552.         virtual void SetLongVal(VCoordinate itsVal, Boolean redraw);// sets cur item no
  553.         virtual SInt16 GetVal();                                    // gets cur item no
  554.  
  555.         AGAPopupMenu*    mAGAObject;
  556.  
  557.     protected:
  558.  
  559.         virtual void CreateAGAObject();
  560.     };
  561.  
  562. //
  563. // AGAStaticTextMA ----------------------------------------------------
  564. //
  565. // TStaticText replacement subclass. Dims with gray text instead of
  566. // patBic gray pattern erasing; suppresses erasing background to white
  567. // when text is changed.
  568. //
  569.  
  570. class AGAStaticTextMA : public TStaticText
  571.     {
  572.     MA_DECLARE_CLASS;
  573.  
  574.     public:
  575.  
  576.         AGAStaticTextMA();
  577.         virtual ~AGAStaticTextMA();
  578.  
  579.         // TStaticText-compatible I method
  580.         void IAGAStaticTextMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, ResNumber itsRsrcID, short itsIndex);
  581.  
  582.         // MacApp overrides
  583.         virtual void DoPostCreate(TDocument* itsDocument);
  584.         virtual void Draw(const VRect& area);
  585.         virtual void SetFrame(const VRect& newFrame, Boolean invalidate); 
  586.         virtual void DimState(Boolean state, Boolean redraw);
  587.         virtual void Dim();
  588.         virtual void SetText(const CStr255& theText, Boolean redraw);
  589.  
  590.         AGAStaticText*    mAGAObject;
  591.  
  592.     protected:
  593.  
  594.         virtual void CreateAGAObject();
  595.     };
  596.  
  597. //
  598. // AGALittleArrowsMA ----------------------------------------------------
  599. //
  600. // TControl subclass. You will need to either install a notification
  601. // routine to respond to arrow tracking, or subclass and override
  602. // the HandleNotification member function. However:
  603. //
  604. // If you simply want to link the little arrows to a TNumberText
  605. // field, just put the TNumberText's view ID the little arrows view's
  606. // fUserArea, and the arrows will automatically increment/decrement
  607. // the TNumberText view's value.
  608. //
  609.  
  610. class AGALittleArrowsMA : public TControl
  611.     {
  612.     MA_DECLARE_CLASS;
  613.  
  614.     public:
  615.  
  616.         AGALittleArrowsMA();
  617.         virtual ~AGALittleArrowsMA();
  618.  
  619.         // TControl-compatible I method
  620.         void IAGALittleArrowsMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, const TextStyle& itsTextStyle = gSystemStyle);
  621.  
  622.         // MacApp overrides
  623.         virtual void DoPostCreate(TDocument* itsDocument);
  624.         virtual void Draw(const VRect& area);
  625.         virtual void SetFrame(const VRect& newFrame, Boolean invalidate); 
  626.         virtual void DoMouseCommand(VPoint& theMouse, TToolboxEvent* event, CPoint hysteresis);
  627.         virtual void DimState(Boolean state, Boolean redraw);
  628.         virtual void Dim();
  629.         
  630.         virtual void    InstallNotificationRoutine(AGANotifyMAPtr notificationRoutine, void* userData);
  631.         virtual void    HandleNotification(SInt32 deltaValue);
  632.         
  633.         AGANotifyMAPtr    mNotificationRoutine;
  634.         void*            mUserData;
  635.  
  636.         AGALittleArrows*    mAGAObject;
  637.  
  638.     protected:
  639.  
  640.         virtual void CreateAGAObject();
  641.         
  642.         static void RealAGANotifier(AGALittleArrows* theAGAObject, SInt32 deltaValue, void* userData);
  643.  
  644.         TNumberText*    mLinkedNumberText;
  645.     };
  646.  
  647. //
  648. // AGADisclosureTriangleMA ----------------------------------------------------
  649. //
  650. // TControl subclass. Set/get the AGADisclosureTriangle state
  651. // directly. Think of it as a check box -- it's either on or off.
  652. //
  653.  
  654. class AGADisclosureTriangleMA : public TControl
  655.     {
  656.     MA_DECLARE_CLASS;
  657.  
  658.     public:
  659.  
  660.         AGADisclosureTriangleMA();
  661.         virtual ~AGADisclosureTriangleMA();
  662.  
  663.         // TControl-compatible I method
  664.         void IAGADisclosureTriangleMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, const TextStyle& itsTextStyle = gSystemStyle);
  665.  
  666.         // MacApp overrides
  667.         virtual void DoPostCreate(TDocument* itsDocument);
  668.         virtual void Draw(const VRect& area);
  669.         virtual void SetFrame(const VRect& newFrame, Boolean invalidate); 
  670.         virtual void DoMouseCommand(VPoint& theMouse, TToolboxEvent* event, CPoint hysteresis);
  671.         virtual void DimState(Boolean state, Boolean redraw);
  672.         virtual void Dim();
  673.  
  674.         AGADisclosureTriangle*    mAGAObject;
  675.  
  676.     protected:
  677.  
  678.         virtual void CreateAGAObject();
  679.     };
  680.  
  681. //
  682. // AGAProgressIndicatorMA ----------------------------------------------------
  683. //
  684. // TControl subclass. Access the AGAProgressIndicator directly. For
  685. // determinate progress, set the min/max range, and then call SetValue
  686. // or Increment repeatedly; you can also update the origin value if
  687. // desired. For indeterminate progress, set min=max and then call Animate
  688. // repeatedly.
  689. //
  690.  
  691. class AGAProgressIndicatorMA : public TControl
  692.     {
  693.     MA_DECLARE_CLASS;
  694.  
  695.     public:
  696.  
  697.         AGAProgressIndicatorMA();
  698.         virtual ~AGAProgressIndicatorMA();
  699.  
  700.         // TControl-compatible I method
  701.         void IAGAProgressIndicatorMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, const TextStyle& itsTextStyle = gSystemStyle);
  702.  
  703.         // MacApp overrides
  704.         virtual void DoPostCreate(TDocument* itsDocument);
  705.         virtual void Draw(const VRect& area);
  706.         virtual void SetFrame(const VRect& newFrame, Boolean invalidate); 
  707.         virtual void DimState(Boolean state, Boolean redraw);
  708.         virtual void Dim();
  709.  
  710.         AGAProgressIndicator*    mAGAObject;
  711.  
  712.     protected:
  713.  
  714.         virtual void CreateAGAObject();
  715.     };
  716.  
  717. //
  718. // AGASeparatorMA ----------------------------------------------------
  719. //
  720. // TView subclass. The precise width or height is irrelevant; the
  721. // longer of the two dimensions determines the separator direction,
  722. // and the separator is drawn along the top or left edge.
  723. //
  724.  
  725. class AGASeparatorMA : public TView
  726.     {
  727.     MA_DECLARE_CLASS;
  728.  
  729.     public:
  730.  
  731.         AGASeparatorMA();
  732.         virtual ~AGASeparatorMA();
  733.  
  734.         // TView-compatible I method
  735.         void IAGASeparatorMA(TDocument* itsDocument, TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet);
  736.  
  737.         // MacApp overrides
  738.         virtual void DoPostCreate(TDocument* itsDocument);
  739.         virtual void Draw(const VRect& area);
  740.         virtual void SetFrame(const VRect& newFrame, Boolean invalidate); 
  741.  
  742.         AGASeparator*    mAGAObject;
  743.  
  744.     protected:
  745.  
  746.         virtual void CreateAGAObject();
  747.     };
  748.  
  749. //
  750. // AGATargetBorderViewMA ----------------------------------------------------
  751. //
  752. // TTargetBorderView replacement subclass.
  753. //
  754.  
  755. class AGATargetBorderViewMA : public TTargetBorderView
  756.     {
  757.     MA_DECLARE_CLASS;
  758.  
  759.     public:
  760.  
  761.         // TTargetBorderView-compatible I method
  762.         void IAGATargetBorderViewMA(TDocument* itsDocument, TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, IDType itsTargetView);
  763.  
  764.         // MacApp overrides
  765.         virtual void Draw(const VRect& area);
  766.         virtual void ComputeBorderRegion(RgnHandle borderRegion);
  767.     };
  768.  
  769. //
  770. // AGATargetBorderFrameViewMA ----------------------------------------------------
  771. //
  772. // TTargetBorderView replacement subclass that also draws a
  773. // AGABorderFrameAdornerMA-type "3D" sunken frame. Provided
  774. // for convenience: makes it unnecessary to attach an
  775. // AGABorderFrameAdornerMA to the subview that this target
  776. // border view surrounds.
  777. //
  778.  
  779. class AGATargetBorderFrameViewMA : public AGATargetBorderViewMA
  780.     {
  781.     MA_DECLARE_CLASS;
  782.  
  783.     public:
  784.  
  785.         // TTargetBorderView-compatible I method
  786.         void IAGATargetBorderFrameViewMA(TDocument* itsDocument, TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, IDType itsTargetView);
  787.  
  788.         // MacApp overrides
  789.         virtual void Draw(const VRect& area);
  790.         virtual void Dim(const VRect& area);
  791.         virtual void SetEnable(Boolean state);
  792.     };
  793.  
  794. //
  795. // AGAGroupBoxMA ----------------------------------------------------
  796. //
  797. // TCluster replacement subclass. Defaults to primary group box
  798. // type.
  799. //
  800.  
  801. class AGAGroupBoxMA : public TCluster
  802.     {
  803.     MA_DECLARE_CLASS;
  804.  
  805.     public:
  806.  
  807.         AGAGroupBoxMA();
  808.         virtual ~AGAGroupBoxMA();
  809.  
  810.         // TCluster-compatible I method
  811.         void IAGAGroupBoxMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, ResNumber itsRsrcID, short itsIndex);
  812.  
  813.         // MacApp overrides
  814.         virtual void DoPostCreate(TDocument* itsDocument);
  815.         virtual void Draw(const VRect& area);
  816.         virtual void SetFrame(const VRect& newFrame, Boolean invalidate);
  817.         virtual void DoMouseCommand(VPoint& theMouse, TToolboxEvent* event, CPoint hysteresis);
  818.         virtual void DimState(Boolean state, Boolean redraw);
  819.         virtual void Dim();
  820.  
  821.         AGAGroupBox*    mAGAObject;
  822.  
  823.     protected:
  824.  
  825.         virtual void CreateAGAObject();
  826.     };
  827.  
  828. //
  829. // AGASecondaryGroupBoxMA ----------------------------------------------------
  830. //
  831. // TCluster replacement subclass that overrides AGAGroupBoxMA to
  832. // use secondary group box appearance.
  833. //
  834.  
  835. class AGASecondaryGroupBoxMA : public AGAGroupBoxMA
  836.     {
  837.     MA_DECLARE_CLASS;
  838.  
  839.         // TCluster-compatible I method
  840.         void IAGASecondaryGroupBoxMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, ResNumber itsRsrcID, short itsIndex);
  841.  
  842.     protected:
  843.  
  844.         virtual void CreateAGAObject();
  845.     };
  846.  
  847. #endif // __GRAYCOUNCILMA__
  848.  
  849.